package com.eastmoney.emis.edda.domain.service.edda;

import javax.validation.constraints.NotEmpty;

/**
 * @description: Description
 * @projectName: EDDA-HSBC
 * @package: com.eastmoney.emis.edda.domain.service
 * @author: 汪程程
 * @date: 2022/9/30 1:08 PM
 * @version: 1.0
 */
public class EddaOtpConfirmCommand {

    @NotEmpty
    private String clientId;

    @NotEmpty
    private String registerId;
    @NotEmpty
    private String bankAccount;
    @NotEmpty
    private String bankCode;
    @NotEmpty
    private String otpId;
    @NotEmpty
    private String otpPassword;

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public String getBankCode() {
        return bankCode;
    }

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;
    }

    public String getOtpId() {
        return otpId;
    }

    public void setOtpId(String otpId) {
        this.otpId = otpId;
    }

    public String getOtpPassword() {
        if(otpPassword.startsWith(otpId)) {
            return otpPassword.substring(3);
        }
        return otpPassword;
    }

    public void setOtpPassword(String otpPassword) {
        this.otpPassword = otpPassword;
    }

    public String getOtpNumber() {
        return this.otpId + ":" + this.otpPassword;
    }

    public String getRegisterId() {
        return registerId;
    }

    public void setRegisterId(String registerId) {
        this.registerId = registerId;
    }

    @Override
    public String toString() {
        return "EddaOtpConfirmCommand{" +
                "clientId='" + clientId + '\'' +
                ", registerId='" + registerId + '\'' +
                ", bankAccount='" + bankAccount + '\'' +
                ", bankCode='" + bankCode + '\'' +
                ", otpId='" + otpId + '\'' +
                ", otpPassword='" + otpPassword + '\'' +
                '}';
    }
}
